package com.yq.cp.controller.basics;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yq.cp.entity.common.ApiResult;
import com.yq.cp.entity.common.PageVo;
import com.yq.cp.entity.permission.User;
import com.yq.cp.service.basics.PositionService;
import com.yq.cp.service.permission.UserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 职位表 前端控制器
 * </p>
 *
 * @author shenyuqing
 * @since 2024-08-27
 */
@RestController
@RequestMapping("/position")
public class PositionController {
    @Resource
    PositionService positionService;
    @Resource
    UserService userService;
    /**
     * 根据名字和手机号匹配
     * @param vo
     * @return
     */
    @PostMapping("listUserToPosition")
    public ApiResult listUserToPosition(@RequestBody User vo){
        User user =  positionService.listUserToPosition(vo);
        return ApiResult.success(user);
    }


    /**
     *组织架构列表
     * @param vo
     * @return
     */
    @PostMapping("structureList")
    public ApiResult structureList(@RequestBody PageVo vo){
        IPage<User> page =  userService.structureList(vo);
        return ApiResult.success(page);
    }
}

